home *** CD-ROM | disk | FTP | other *** search
Wrap
-- colorizeHC "add", "Crayons", "140,190", "140,190,279,268", "transparent" -- Crayons <-- This is the picture's name on mouseUp if the short name of me is "Transparent Normal Rez" then set the name of me to "Help" askfornamehelp exit mouseup end if if the short name of me is help then askfornamehelp exit mouseup end if global Tools if the shiftkey is down and the commandkey is down then checkTools if Tools is not "Nope" then newResource exit mouseup else exit mouseup end if if the commandKey is down then newName exit mouseup end if if the shiftkey is down and the optionkey is down then changeAttributes exit mouseup end if if the optionkey is down then readytoscript exit mouseup end if if the shiftKey is down then deletelastColor colorizeHC "Erase", rect of me set the showName of me to true go to this cd exit mouseup end if dothecolor pass mouseup end mouseup on locateMe put "-- " && "colorizeHC" && quote & "add" & quote & "," && quote &¬ the short name of me & quote & "," ¬ && quote & the topleft of me & quote & "," && quote & the rect of me & quote & "," && quote & "transparent" & quote into line 1 of insertLine put the script of me into holdScript put line 1 of insertLine into line 1 of holdScript put "-- " && the short name of me && "<-- This is the picture's name" into line 2 of holdScript set the script of me to holdScript end locateMe on newResource answer "You are about to import a new resource into your"&&¬ "stack from a PICT file. You may either type in a name now"&&¬ "or locate the PICT file you are going to import with a standard open dialog."¬ with "Cancel" or "Type It" or "Locate" if it is "Cancel" then exit newResource if it is "Type It" then ask "Type your resource name:" with "My Resource" if it is empty then exit newResource put it into holdPictName answer "You will now be asked to locate the picture file that you will call" &&¬ quote & holdPictname & quote && "with a standard"&&¬ "open dialog. (The PICT file name doesn't have to match the name you"&&¬ "have chosen for the resource.)" with "Okay" end if if it is "Locate" then answer file "Choose your picture name by selecting it:" of type PICT if it is empty then exit newResource put it into process get the last char of process if it is ":" then exit newResource answer "Try later with a better picture name." with "I know" end if if it is not ":" then put it into holdPictName delete last char of process repeat until it is ":" get the last char of process if it is not ":" then put it before char 1 of holdPictName delete the last char of process -- this could be shorter with end repeat -- changing itemDelimiter to ":", but would require HC 2.1 end if answer "You will now be asked to locate the picture file that you will call" &&¬ quote & holdPictname & quote && "with another standard"&&¬ "open dialog. You should now choose the same file again."¬ with "Okay" end if put reslist () into resData -- This allows a check for duplicate names get offset (holdPictName, resData) -- of resources since FileToPICTRes does not if it is not "0" then answer "There is already a resource named" && quote & holdPictName & quote &&¬ "in this stack. Are you sure that you want to replace it with this picture?"¬ with "Replace" or "Cancel" if it is "Cancel" then exit newResource else get FileToPICTRes ( ,holdPictname ,PICT) if it is "Cancel" then exit newResource else put the script of me into holdScript set the script of me to holdScript set the name of me to holdPictname colorizeHC "erase", the rect of me set the showName of me to true dothecolor end if end if end if end newResource on checkTools global Tools get the short name of this stack if it is "ResGenie™" then put "Yep" into Tools exit checkTools end if do get offset ("ResGenie™", the stacksinuse) if it is not "0" then put "Yes" into tools exit checktools end if if it is "0" then answer "You need to use" && quote & "ResGenie™" & quote &¬ "for this feature to work." with "Cancel" or "Use" if it is "Use" then start using stack "ResGenie™" put "Yes" into Tools else if it is "Cancel" then put "Nope" into Tools end if end if end if end checkTools on newName global Tools ask "What is the icon name?" with the short name of me if it is the short name of me then exit newName if it is "Help" then checkTools get Tools if it is "Nope" then exit newname set the name of me to "Help" colorizeHC "Erase", the rect of me askfornamehelp exit newName end if if it is empty then set the showName of me to true dothecolor answer "Every button wants a name even if it's the same OLD name" with "Gotcha" exit newName end if set the name of me to it colorizeHC "erase", the rect of me set the showName of me to true dothecolor end newName on dothecolor if the showName of me is true then locateMe set the showName of me to false put line 1 of the script of me into colorCommand delete word 1 of colorCommand do colorCommand else if the showName of me is false then colorizeHC "erase", rect of me set the showname of me to true end if end if go to this cd end dothecolor on deletebutton colorizeHC "erase", the rect of me end deletebutton on readytoScript set cursor to watch put "Now checking all scripts..." global holdScript global colorauthoringpath get offset ("makeitcolor", the script of this stack) if it is "0" then do restext ("TEXT", "colorscriptsmoothe", colorauthoringpath) get offset ("on makeitcolor", the script of this bg) if it is "0" then do restext ("TEXT", "colorscriptsmoothe", colorauthoringpath) get offset ("on makeitcolor", the script of this cd) if it is "0" then do restext ("TEXT", "colorscriptsmoothe", colorauthoringpath) set the showname of me to true dothecolor put line 1 of the script of me into line 1 of insertLine delete word 1 of insertLine put the name of me into check if word 1 of check is "bkgnd" then put the script of this bg into holdScript put "bg" into wheretoGo put "send makeitcolor to this cd" into whattoSee put the name of this bg into myName end if if word 1 of check is "card" then put the script of this cd into holdScript put "cd" into wheretoGo put "end makeitcolor" into whattoSee put the name of this cd into myName end if get offset (insertLine, holdScript) if it is not "0" then answer "This picture has already been added here. Do you want to convert this to an ordinary button now?"¬ with "Yes" or "No" if it is "Yes" then do showdialog 3, "510", , ,short name of me , "7",, if the result is empty then exit readytoscript put the result into hold if line 1 of hold is "6" then set the style of me to "Transparent" if line 1 of hold is "5" then put word 1 to 2 of the name of me && "id" && the id of me into hold select hold domenu "Clear Button" choose browse tool set lockscreen to true opencard exit readytoscript end if set the name of me to line 2 of hold put "on mouseup" into line 1 of temp put " " into line 2 of temp put "end mouseup" into line 3 of temp set the script of me to temp end if exit readytoscript if it is "No" then exit readytoscript end if put quote & rect of me & quote into checkRegion get offset (checkRegion, holdScript) if it is "0" then do put offset (whattoSee, holdscript) into whereGo put insertLine & return before char whereGo of holdScript -- this should add the new colors do set the script of myName to holdScript do put "This picture has been added to" && the name of wheretoGo into message answer "Do you want to convert this to an ordinary button now?"¬ with "Yes" or "No" if it is "Yes" then do showdialog 3, "510", , ,short name of me , "7",, if the result is empty then exit readytoscript put the result into hold if line 1 of hold is "6" then set the style of me to "Transparent" if line 1 of hold is "5" then put word 1 to 2 of the name of me && "id" && the id of me into hold select hold domenu "Clear Button" choose browse tool set lockscreen to true opencard exit readytoscript end if set the name of me to line 2 of hold put "on mouseup" into line 1 of temp put " " into line 2 of temp put "end mouseup" into line 3 of temp set the script of me to temp end if exit readytoscript end if if it is not "0" then answer "You are painting in an area already painted. This is not necessarily a problem, but painting the same region twice will take longer." ¬ with "Cancel" or "Continue" end if if it is "Cancel" then exit readytoScript if it is "Continue" then do put offset (whattoSee, holdscript) into whereGo put insertLine & return before char whereGo of holdScript -- this should add the new colors do set the script of myName to holdScript do put "This overlapping color has been added to" && the name of wheretoGo into message answer "Do you want to convert this to an ordinary button now?"¬ with "Yes" or "No" if it is "Yes" then do showdialog 3, "510", , ,short name of me , "7",, if the result is empty then exit readytoscript put the result into hold if line 1 of hold is "6" then set the style of me to "Transparent" if line 1 of hold is "5" then put word 1 to 2 of the name of me && "id" && the id of me into hold select hold domenu "Clear Button" choose browse tool set lockscreen to true opencard exit readytoscript end if set the name of me to line 2 of hold put "on mouseup" into line 1 of temp put " " into line 2 of temp put "end mouseup" into line 3 of temp set the script of me to temp end if exit readytoscript end if end readytoScript on deleteLastColor put line 1 of the script of me into line 1 of insertLine delete word 1 of insertLine put the name of me into check if word 1 of check is "bkgnd" then put the script of this bg into holdscript put "bg" into wheretoGo put the name of this bg into myName else put the script of this cd into holdScript put "cd" into wheretoGo put the name of this cd into myName end if get offset (insertLine, holdScript) if it is 0 then answer "This picture has already been deleted" with "Okay" exit deleteLastColor end if get offset ("add", holdScript) if it is 0 then answer "You have already erased all the pictures here" with "I knew that" exit deleteLastColor end if put the number of lines of char 1 to offset(insertLine, holdScript) ¬ of holdscript into KillLine delete line KillLine of holdScript colorizeHC "Erase", rect of me go to this cd do put "This picture has been removed from" && the name of wheretoGo into message do set the script of myName to holdScript end deleteLastColor on changeAttributes answer "Do you want this button to create a" && quote & "scaling" & quote && "picture?"¬ with "Cancel" or "Scaling" or "Normal" if it is "Cancel" then exit changeAttributes put the script of me into holdScript put offset ("on locateMe", holdScript) into startPoint put startPoint into oldStart put offset ("end locateMe", holdScript) + 11 into endPoint put char startpoint to endPoint of holdScript into newLocateMe delete char startpoint to endPoint of holdScript put offset ("put", newLocateMe) into startPoint put offset ("insertline", newLocateMe) + 10 into endPoint delete char startPoint to endPoint of newLocateMe -- put offset ("end mouseup", holdScript) + 10 into Destination colorizeHC "erase", the rect of me set the showName of me to false if it is "Normal" then -- foop put "-- " && "colorizeHC" && quote & "add" & quote & "," && quote &¬ -- the short name of me & quote & "," ¬ -- && quote & the topleft of me & quote & "," && quote & the rect of me & quote & "," && quote & "transparent" & quote into line 1 of insertLine -- endfoop put offset ("foop", holdScript) + 4 into startpoint put offset ("endfoop", holdScript) - 4 into stopPoint put char startpoint to stoppoint of holdScript into holdCommand answer "Do you want an opaque or transparent picture to be used?" with¬ "Transparent" or "Opaque" if it is "Transparent" then put offset ("-- && q", holdCommand) into startPoint delete char startpoint to startPoint + 1 of holdCommand put offset ("-- the", holdCommand) into startPoint delete char startpoint to startPoint + 1 of holdCommand put return & holdCommand after line 1 of newLocateme put newLocateme & return into char oldStart of holdScript colorizeHC "Add", the short name of me, the topleft of me , the rect of me, "transparent" end if if it is "Opaque" then put offset ("the rect of me", holdCommand) into startpoint put the number of chars of holdCommand into endPoint delete char startpoint to endPoint of holdCommand put space & "rect of me & quote into line 1 of insertline" after last char of holdCommand put offset ("-- && q", holdCommand) into startPoint delete char startpoint to startPoint + 1 of holdCommand put offset ("-- the", holdCommand) into startPoint delete char startpoint to startPoint + 1 of holdCommand put return & holdCommand after line 1 of newLocateme put newLocateme & return into char oldStart of holdScript colorizeHC "Add", the short name of me, the topleft of me, the rect of me end if end if if it is "Cancel" then exit changeAttributes if it is "Scaling" then -- boink put "-- " && "colorizeHC" && quote & "add" & quote & "," && quote &¬ -- the short name of me & quote & "," ¬ -- && quote & the rect of me & quote & "," && "," && quote & "copy with dithering" & quote into line 1 of insertLine -- endboink put offset ("boink", holdScript) + 5 into startpoint put offset ("endboink", holdScript) - 4 into stopPoint put char startpoint to stoppoint of holdScript into holdCommand answer "Do you want an opaque or transparent picture to be used?" with¬ "Transparent" or "Opaque" if it is "Opaque" then put offset ("transparent", holdCommand) into startpoint if startpoint is 0 then put offset ("-- && q", holdCommand) into startPoint delete char startpoint to startPoint + 1 of holdCommand put offset ("-- the", holdCommand) into startPoint delete char startpoint to startPoint + 1 of holdCommand put return & holdCommand after line 1 of newLocateme put newLocateme & return into char oldStart of holdScript colorizeHC "Add", the short name of me, the rect of me ,, "copy with dithering" end if end if if it is "Transparent" then put offset ("copy", holdCommand) into startpoint if startpoint is 0 then put holdCommand into cd fld "Test Run" exit changeAttributes end if put startpoint + 4 into stoppoint delete char startpoint to stoppoint of holdCommand put "transparent" & space before char startpoint of holdCommand put offset ("-- && q", holdCommand) into startPoint delete char startpoint to startPoint + 1 of holdCommand put offset ("-- the", holdCommand) into startPoint delete char startpoint to startPoint + 1 of holdCommand put return & holdCommand after line 1 of newLocateme put newLocateme & return into char oldStart of holdScript colorizeHC "Add", the short name of me, the rect of me,, "transparent with dithering" end if end if set the script of me to holdScript go to this cd end changeAttributes